package com.huilang.domo1;

import java.util.Map;
/**
 * @version v1.0
 * @ClassName: Command
 * @Description: 抽象命令类
 * @Author: 黑马程序员
 */
public interface Command {
    void execute();
}

class OrderCommand implements Command {
    private  SeniorChef seniorChef;
    private  Order order;
    public OrderCommand(SeniorChef seniorChef, Order order) {
        this.seniorChef = seniorChef;
        this.order = order;
    }


    @Override
    public void execute() {
        System.out.println(order.getDiningTable());
        Map<String, Integer> foodDir = order.getFoodDir();
        for (Map.Entry<String, Integer> entry : foodDir.entrySet()) {
            seniorChef.makefood(entry.getKey(), entry.getValue());
        }
        System.out.println(order.getDiningTable()+"卓准备好了");
    }
}